import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '请假人',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '头像',
    align: "center",
    dataIndex: 'pic',
    customRender: render.renderImage,
  },
  {
    title: '性别',
    align: "center",
    dataIndex: 'sex_dictText'
  },
  {
    title: '请假天数',
    align: "center",
    dataIndex: 'days'
  },
  {
    title: '部门',
    align: "center",
    dataIndex: 'depId_dictText'
  },
  {
    title: '上级领导',
    align: "center",
    dataIndex: 'depLeader_dictText'
  },
  {
    title: '请假原因',
    align: "center",
    dataIndex: 'ccc'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '请假人',
    field: 'name',
    component: 'Input',
  },
  {
    label: '头像',
    field: 'pic',
    component: 'JImageUpload',
    componentProps:{
    },
  },
  {
    label: '性别',
    field: 'sex',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "sex"
    },
  },
  {
    label: '请假天数',
    field: 'days',
    component: 'InputNumber',
  },
  {
    label: '部门',
    field: 'depId',
    component: 'JSelectDept',
  },
  {
    label: '上级领导',
    field: 'depLeader',
    component: 'JSelectUserByDept',
    componentProps:{
      labelKey: 'realname',
    },
  },
  {
    label: '请假原因',
    field: 'ccc',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
